package com.xiaoke.shiro;

import com.xiaoke.entity.User;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Component;

@Component
public class SecurityService {
    public User getCurrentUser(){
        Object principal = SecurityUtils.getSubject().getPrincipal();
        return (User) principal;
    }
}
